import { quartz as http } from '@zh/common-utils/http'
export { http }

/**
 * 开启任务
 */
export const startTask = function (id) {
  return http.post(`/sysJob/start/${id}`)
}

/**
 * 关闭任务
 */
export const stopTask = function (id) {
  return http.post(`/sysJob/stop/${id}`)
}

/**
 * 获取任务
 */
export const getByIdTask = function (id) {
  return http.get(`/sysJob/getById/${id}`)
}

/**
 * 删除任务
 */
export const deleteTask = function (params) {
  return http.post(`/sysJob/delete?ids=${params}`)
}

/**
 * 新增任务
 */
export const saveOrUpdateTask = function (params) {
  return http.post(`/sysJob/saveOrUpdate`, params)
}

/**
 * 获取列表接口
 */
export const listTask = function (params) {
  return http.post(`/sysJob/list`, params)
}